//
//  JKTestView.m
//  MVCTest
//
//  Created by 王冲 on 2018/9/29.
//  Copyright © 2018年 JK科技有限公司. All rights reserved.
//

#import "JKTestView.h"

@interface JKTestView ()

@end

@implementation JKTestView

-(instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    
    if (self) {
        
        [self addSubview:self.label];
    }
    
    return self;
}

#pragma mark 所有的操作都放到 model里面传过来
-(void)setModel:(JKTestModel *)model{
    
    _model = model;
    
    self.label.text = _model.name;
}

-(UILabel *)label{
    
    if (!_label) {
        
        _label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
        _label.textColor = [UIColor purpleColor];
        _label.font = [UIFont systemFontOfSize:20];
        _label.textAlignment = NSTextAlignmentCenter;
    }
    
    return _label;
}

@end
